Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: simplify Dockerfile and add docker image testing #10021

Merged
merged 3 commits into from
Jul 27, 2023
Merged

Conversation

galargh
Copy link
Contributor

@galargh galargh commented Jul 19, 2023

Dockerfile

This change splits the builder stage into builder and utilities stages. This is to make the distinction between buildtime and runtime dependencies clearer. More importantly, this makes sure that the runtime dependencies we download are for the target platform.

It also install tini and su-exec* from APT repository rather than GitHub. This makes the installs simpler because we don't have to checkout git repos anymore.

Finally, it replaces su-exec with gosu. This is because su-exec is not distributed through APT. However, gosu comes in at around 2MB while su-exec is ~20KB. Let me know if we should go back to su-exec for the size benefits.

GitHub Actions

This PR adds bare minimum testing of produced images. It adds it to both docker-build and docker-image workflows (Should we get rid of docker-build one?). The testing consists of running --version in the produced image.

In case of docker-image, I had to split docker-build-and-publish into build and publish phases. Furthermore, I had to split build into 3 separate builds for each platform. This is because we want all the produced images loaded and it's impossible to do with multi-platform build.

The testing in docker-image all happens on amd64 instance. So other platforms are being emulated.

Testing

Fixes ARM images and:
closes #9901
closes #7541

@galargh galargh requested a review from lidel July 19, 2023 07:32
@galargh galargh requested a review from a team as a code owner July 19, 2023 07:32
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for cleaning this up. Let's keep existing actions for now, adding this --version check is enough.
Sgtm, let's merge this, so we see how it behaves in real world (if it increases build time much) before final 0.22 is released.

@lidel lidel merged commit c5868a8 into master Jul 27, 2023
@lidel lidel deleted the ci-docker-test branch July 27, 2023 17:53
@lidel
Copy link
Member

lidel commented Jul 27, 2023

@galargh just tested and confirmed kubo:master-2023-07-27-c5868a8 works fine on ARM 👍 thanks again for fixing this! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
2 participants